@import '../variables/index.scss';

@mixin date-header() {
  position: absolute;
  top: 0;
  color: $black-900;
  padding: 0 5px;
  font-size: 16px;
  display: inline-block;
  line-height: 34px;
}

@mixin date-select() {
  padding: 0 2px;
  font-weight: 700;
  display: inline-block;
  color: $black-600;
  line-height: 34px;
}

.at-datepicker {
  position: relative;
  outline: none;
  width: 231px;
  border: 1px solid #fff;
  list-style: none;
  font-size: 12px;
  text-align: left;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .2);
  background-clip: padding-box;
  line-height: 1.5;
  a {
    &:hover {
      color: $blue-500;
    }
  }

  &--panel {
    position: relative;
    &--header {
      height: 34px;
      line-height: 34px;
      text-align: center;
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
      border-bottom: 1px solid $grey-50;
      .pre-year-btn {
        left: 7px;
        @include date-header();
        &:after {
          font-family: feather;
          content: '\E849'
        }
      }
      .pre-month-btn {
        left: 29px;
        @include date-header();
        &:after {
          font-family: feather;
          content: "\E843";
        }
      }

      .current-select-label {
        .month-select {
          @include date-select;
          &:hover {
            color: $blue-500;
          }
        }
        .year-select {
          @include date-select;
          &:hover {
            color: $blue-500;
          }
        }

      }

      .next-year-btn {
        @include date-header();
        right: 7px;
        &:after {
          font-family: feather;
          content: "\E847";
        }
      }
      .next-month-btn {
        @include date-header();
        right: 29px;
        &:after {
          font-family: feather;
          content: "\E844";
        }

      }

    }

    &--body {

      .at-calendar-table {
        border-collapse: collapse;
        max-width: 100%;
        background-color: transparent;
        width: 100%;
        thead {
          .column-header {
            line-height: 18px;
            width: 33px;
            padding: 6px 0;
            text-align: center;
            &-inner {

            }
          }
        }

        tbody {
          .at-date-cell, .at-month-cell {
            padding: 4px 0;
            .at-date {
              display: block;
              margin: 0 auto;
              color: $black-500;
              border-radius: 2px;
              width: 20px;
              height: 20px;
              line-height: 18px;
              border: 1px solid transparent;
              padding: 0;
              background: transparent;
              text-align: center;
              cursor: pointer;
              transition: background .3s ease;
              &:hover {
                background: $blue-100;
                cursor: pointer;
              }
            }
            &--last-month {
              .at-date {
                color: $grey-500;
              }
            }
            &--next-month {
              .at-date {
                color: $grey-500;
              }
            }
            &--today {
              .at-date {
                border: 1px solid $blue-500;

              }
            }
            &--selected {
              .at-date {
                background: $blue-500;
                color: white;
                &:hover {
                  background: $blue-500 !important;
                }
              }
            }

          }
          .at-month-cell {
            text-align: center;
            .at-date {
              width: 40px;
              height: 36px;
              line-height: 36px;
            }
          }
        }
      }

    }
  }

}
